Changes how dark the current dark room is, in percent, while the game runs. 0 shows the room as if it were lit and 100 is black. Only the darkness changes: the lights you made still cut their holes through it.
Works differently on Game Boy - room_set_shroud_darkness changes how dark a dark room is at once, in 16 steps from light to black. A shade the game changed itself stays as the game set it, and a palette swap keeps the darkness it had.
Works differently on Game Boy Color - room_set_shroud_darkness changes how dark a dark room is, as on the Advance. The room's colors are written again a few at a time, so the change takes up to 5 frames. A picture or sprite that wears a palette swap keeps the darkness it had.
Works differently on Sega Genesis - The Sega Genesis has one dark level: half as bright as the picture. Every darkness number above 0 shows that same dark (a room set to 72 is no darker than one set to 50), and 0 is no dark at all. Each light cuts its hole in that dark, in the shape and size set in Gbabel and in the directions and sizes the code asks for; a light's hole is a picture made ahead of time, so a size or a direction the code works out while the game plays is shown as the nearest one made. An object stands in the light as a whole while its middle is in the light. A light near the edge of the screen is whole or gone, and an object lit by room lights keeps its own colors.
On other consoles this differs: see Side by side and How the consoles differ.
room_set_shroud_darkness(percent)| Name | Type |
|---|---|
percent | real |
Nothing.
Changes how dark the current room is, in percent, while the game runs. 0 shows the room as if it were lit, 100 makes the dark black. A number below 0 counts as 0 and a number above 100 counts as 100.
The room has to be a dark room: tick Shrouded in Room Properties (open Transitions and Values). The Darkness number there is how dark the room starts; this call changes it afterwards. In a room that is not dark the call does nothing.
Only the darkness changes. The lights you made with shroud_cutout (a lantern, a brazier, a torch) still cut their pools of light through it, so a room can get darker and the lights stay as bright as they were. That is what makes a boss that dims the room work: the room goes dim, the lanterns still glow.
The change is at once. To fade, call it every step with a number that moves a little each time, for example one that tween_to moves for you. It lasts until the room is loaded again, which puts back the Darkness set in Room Properties, so leaving the room and coming back starts from the room's own darkness.
A game that never calls it does not carry any of this.
room_set_shroud_darkness(90);Makes the dark room almost black. Any lights in the room still show. Call room_set_shroud_darkness(40) to bring the room back to a dim, easy-to-see dark.
The room has to be a dark room (Shrouded is ticked in Room Properties; its Darkness number is what the room starts with); in any other room the call does nothing. A number below 0 counts as 0 and above 100 as 100. The change stays until the room is loaded again, which puts back the darkness set in Room Properties. The change is at once, with no fade: to fade, call it every step with a number that moves a little each time (tween_to on a variable does this well). Only a game that calls it carries the code for it.